<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<div class="col-sm-3">
	<form id='userQueryForm'>
	<div class="input-group">
		<input value="${parameterDto.account }" type="text" name="account" class="form-control search-query" placeholder="输入登录账号">

		<span class="input-group-btn">
			<button type="button" class="btn btn-purple btn-sm" onclick="refreshPage()">
				<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
				查询
			</button>
			<button style="margin-left:10px;" type="button" class="btn btn-primary btn-sm" onclick="addUser()">
				<span class="ace-icon fa fa-plus icon-on-right bigger-110"></span>
				新增
			</button>
		</span>
	</div>
	</form>
</div>
<div class="col-xs-12" style="margin-top:5px;">
	<table id="simple-table" class="table table-bordered table-hover">
		<thead>
			<tr>
				<th class="center">ID</th>
				<th class="center">登录账号</th>
				<th class="center">用户姓名</th>
				<th class="center">联系方式</th>
				<th class="center">角色</th>
				<th class="center">当前余额</th>
				<th class="center">总提成</th>
				<th class="center">提成比例</th>
				<th class="center">状态</th>
				<th class="center">操作</th>
			</tr>
		</thead>
		
		<tbody>
			<c:forEach items="${data}" var="item" varStatus="i">
		       <tr>
					<td class="center">${item.id }</td>
					<td class="center">${item.account }</td>
					<td class="center">${item.name }</td>
					<td class="center">${item.mobile }</td>
					<td class="center">${item.roleName }</td>
				    <td class="center">${item.score==null?0:item.score } (<fmt:formatNumber value="${item.score==null?0:item.score/100 }" pattern="0.00"/>)</td>
				    <td class="center">0</td>
				    <td class="center">
				    	<c:if test="${empty  item.persent}"></c:if>
				    	<c:if test="${not empty item.persent}">${ item.persent}%</c:if>
				    </td>
				    <td class="center">
						<c:choose>
							<c:when test="${item.status ==0}">正常</c:when>
							<c:when test="${item.status ==1}">禁用</c:when>
						</c:choose>
					</td>
					<td class="center">
						<c:if test="${item.roleName == '运营号' }">
							<a class="btn btn-xs btn-danger" title="查看下属" onclick="seeChildren(${item.id},'${item.name}')">查看下属</a>
						</c:if>
						<c:if test="${'admin' != item.account}" >
						<a class="btn btn-xs btn-danger" title="查看提成明细" href="javascript:void(0)" 
						onclick="openGoldDetail(${item.id})">查看提成明细</a>
						<c:if test="${item.roleName == '运营号' }">
							<a class="btn btn-xs btn-danger" title="充值" onclick="bjs(${item.id},${item.score==null?0:item.score })">充值</a>
						</c:if>
						</c:if>
					</td>
				</tr>
				<tr id="detail${i.index + 1}" class="detail-row">
					<td colspan="10">
						<textarea style="height: 60px;" class="width-100" resize="none" placeholder=""><c:if test="${not empty item.userIds}">${item.userIds}</c:if><c:if test="${empty item.userIds}">全部玩家</c:if></textarea>
					</td>
				</tr>
		    </c:forEach>
				
			</tbody>
		</table>
		<%@include file="../paging.jsp" %>
</div>

